import React, { useState } from 'react'

const Foo: React.FC = () => {
  // 初始值为string类型3.14, state可以为string或者number
	let [state, setState] = useState<string | number>('3.14')

	const addcount = () => {
		setState((state = Date.now()))
	}

	return (
		<>
			<button onClick={addcount}>A:count++ =&gt; {state}</button>
		</>
	)
}
export default Foo
